package com.springboot.template.thread.runnable;

public class MyRunnable {
    public static void main(String[] args) {
        Thread thread = new Thread(new Runnable() {
            public void run() {
                System.out.println("使用匿名内部类创建Thread子类对象");
                System.out.println(Thread.currentThread().getName());
            }
        });
//        thread.start();

        Thread t2 = new Thread(() -> System.out.println("lambda表达式创建Runnable子类对象" + Thread.currentThread().getName() + " id " + Thread.currentThread().getId()));
        t2.start();

    }
}
